import QueryForm from '@/components/SearchForm'
import { Space, Form, Input, Select } from 'antd'
import { TableData } from './types'
export const IndexSearchForm = (props: SearchFormProps<TableData>) => {
  const { onFinish, onReset } = props
  return (
    <QueryForm
      onFinish={onFinish}
      onReset={onReset}
      searchConfig={[
        {
          name: 'keywords',
          label: '',
          type: 'Custom',
          slot: (
            <Space.Compact>
              <Form.Item name="type" initialValue={1}>
                <Select
                  options={[
                    { label: 'sn编号', value: 1 },
                    { label: '物联网卡号', value: 2 },
                    { label: '发放应用', value: 3 },
                    { label: '发放对象', value: 4 },
                  ]}
                  style={{ minWidth: 130 }}
                  placeholder="请选择搜索项"
                />
              </Form.Item>
              <Input style={{ minWidth: 200 }} />
            </Space.Compact>
          ),
        },
      ]}
    ></QueryForm>
  )
}
export const SearchForm = (props: SearchFormProps<TableData>) => {
  const [formSearch] = Form.useForm()
  const { onFinish, onReset } = props
  return (
    <QueryForm
      onFinish={onFinish}
      onReset={onReset}
      searchConfig={[
        {
          label: '事件',
          name: 'ev',
          type: 'Select',
          option: [{ label: 1, value: '1' }],
        },
      ]}
    ></QueryForm>
  )
}
